<!DOCTYPE html>
<html>
    <head>
        <meta charset="UTF-8"/>
        
        <script src="./js/vue@2.6.20.min.js"></script>
       
     <!--   <script src="./js/vue.min.js"></script>-->
    </head>
    <body>
        <div id="root">
            <h1>你好,{{name}}</h1>
            <button v-on:click='showinfo'>你好</button>
        </div>
    </body>
    
    <script type="text/javascript">
   var v= new Vue({
       // el:'#root',
        data:function() {
            return {
                name:"lucy2"
            }
        },
        methods:{
            showinfo(){
                alert("大家好") 
            }
        }
  
})
    console.log(v)
    v.$mount('#root')
    let number=20
    let person= {
        name: 'LUCY',
        sex: "女"
    }
    Object.defineProperty(person,'age',{
        // value:25,//给参数赋值
        // enumerable: true,//是否枚举
        // writable: true,//是否可以重写
        // configurable:true//是否可删除


        //数据代理
        get(){
            return number
        },
        set(value){
            return number=value
        }

    })
    console.log(person)
    
    </script>

</html>